package com.zxb.base.autoform.enm;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Zxb
 */
public enum ColumnFixedEnum {
    ID("ID", "NUMBER", "20"),
    CREATE_BY("CREATE_BY", "NVARCHAR2", "50"),
    UPDATE_BY("UPDATE_BY", "NVARCHAR2", "50"),
    VER("VER", "NUMBER", "11"),
    IS_DEL("IS_DEL", "NUMBER", "4"),
    SEARCH_STR("SEARCH_STR", "NVARCHAR2", "255"),
    FLOW_INST_CODE("FLOW_INST_CODE", "NVARCHAR2", "255"),
    CREATE_TIME("CREATE_TIME", "DATE", null),
    UPDATE_TIME("UPDATE_TIME", "DATE", null);

    private final String code;
    private final String type;
    private final String size;

    ColumnFixedEnum(String code, String type, String size) {
        this.code = code;
        this.type = type;
        this.size = size;
    }

    public static List<String> getCodes() {
        return Arrays.stream(ColumnFixedEnum.values()).map(column -> {
            return column.getCode().toUpperCase();
        }).collect(Collectors.toList());
    }

    public String getCode() {
        return code;
    }

    public String getType() {
        return type;
    }

    public String getSize() {
        return size;
    }
}
